<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="java.util.List" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.Random" %>
<%@ page import="com.ccxe.manage.bo.OperatorPassword" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"+ request.getServerName() + ":" + request.getServerPort()+ path + "/";
OperatorPassword operatorPassword=(OperatorPassword)request.getAttribute("operatorPassword");
if(operatorPassword==null)operatorPassword=new OperatorPassword();
String currentPage=(String)request.getAttribute("currentPage");
%>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=7" />

<link id="rightCss" rel="stylesheet" type="text/css" href="<%=basePath%>css/right.css" />

<script src="<%=path%>/js/jquery_last.js" type="text/javascript"></script>
<script  src="<%=path%>/js/formValidator.js" type="text/javascript"></script>
<script src="<%=path%>/js/formValidatorRegex.js" type="text/javascript"></script>

<script type="text/javascript" src="/jsp/ui/js/base.js"></script>
<script type="text/javascript" src="<%=path%>/js/MzCalendar.js"></script>
<script type="text/javascript" src="<%=path%>/js/WdatePicker.js"></script>

<script type="text/javascript">
$(document).ready(function(){$.formValidator.initConfig({formid:"myForm",onerror:function(msg){alert(msg)},onsuccess:function(){return true;}});
	$("#operatorName").formValidator({onshow:" ",onfocus:" ",oncorrect:""}).inputValidator({min:1,max:20,onerror:"姓名至少1位，至多20位"});
	$("#password").formValidator({onshow:" ",onfocus:" ",oncorrect:""}).inputValidator({min:6,max:20,onerror:"密码至少6位至多20位"});
	$("#repassword").formValidator({onshow:"请输入确认密码",onfocus:" ",oncorrect:""}).inputValidator({min:6,max:20,onerror:"密码至少6位,至多20位"}).compareValidator({desid:"password",operateor:"=",onerror:"2次密码不一致,请确认"});
	$("#pwdExpireDate").formValidator({onshow:" ",onfocus:" ",oncorrect:""}).inputValidator({min:8,max:10,onerror:"时间非法"});
});

function update(){
var flag = $.formValidator.pageIsValid("1");
if(flag == true){
	document.myForm.action = 'passwordServlet?method=update';
    document.myForm.submit();
}
}

</script>
</head>
<body class="role">  
<div class="crumbs">当前位置：首页  &gt; 添加管理员</div>
<div class="search ctitle">
	<div class="tab">
		<span class="right"></span>
		<span class="font-blue14pxb">基本情况</span>
	</div>
</div>
<form name="myForm" id="myForm" action="#" method="post">
<input type="hidden" name="currentPage" value="<%=currentPage%>"/>
<div class="tableBox fwidth">
<table width="100%" align="center" border="0" cellpadding="0" cellspacing="0">
	    <tr>
			<th width="30%" class="h">用户ID</th>
			<td colspan="10" class="text_left"><input type="text" name="operatorId" id="operatorId" style="width:aotu;width: 150px;color: #325f86;" value="<%=operatorPassword.getOperatorId()%>" readonly="readonly"/></td>
		</tr>
	    <tr>
			<th width="30%" class="h">姓名</th>
			<td colspan="10" class="text_left">
			<input type="text" name="operatorName" id="operatorName" style="width:aotu;width: 150px;color: #325f86;" value="<%=operatorPassword.getOperatorName()%>"/>
			<div id="operatorNameTip" style="width:250px"></div>
			</td>
		</tr>
		<tr>
			<th width="30%" class="h">密码</th>
			<td colspan="10" class="text_left">
			<input type="password" name="password" id="password" style="width:aotu;width: 150px;color: #325f86;" />
			<span id="passwordTip" style="width:250px"></span>
			</td>
		</tr>
		<tr>
			<th width="30%" class="h">确认密码</th>
			<td colspan="10" class="text_left">
			<input type="password" name="repassword" id="repassword" style="width:aotu;width: 150px;color: #325f86;"/> 
			<span id="repasswordTip" style="width:250px"></span>
			</td>
		</tr>
		<tr>
			<th width="30%" class="h">是否禁用</th>
			<%
			String accountDeleted=operatorPassword.getAcountDeleted();
			int flag=0;
			if("1".equals(accountDeleted))flag=1;
			 %>
			<td colspan="10" class="text_left">
			  <input type="radio" name="acountDeleted" id="acountDeleted" value="0" <%if(flag==0)out.print("checked");%>>否</input>
			  <input type="radio" name="acountDeleted" id="acountDeleted" value="1" <%if(flag==1)out.print("checked");%>>是</input>
			</td>
		</tr>
		<tr>
			<th width="30%" class="h">密码过期时间</th>
			<%
			Date pwdExpireDate=operatorPassword.getPwdExpireDate();
			 %>
			<td colspan="10" class="text_left">
	        	<input type="text" class="text" id="pwdExpireDate" name="pwdExpireDate"style="width: 150px;color: #325f86;" value="<%=pwdExpireDate.toString()%>" onclick="WebCalendar.start(this,document.getElementById('myForm').pwdExpireDate, 'yyyy-MM-dd')"/>
			    <div id="pwdExpireDateTip" style="width:250px"></div>
			</td>
		</tr>
		<tr>
			<th width="30%" class="h">最近修改时间</th>
			<%
			Date pwdChangeDate=operatorPassword.getPwdChangeDate();
			%>
			<td colspan="10" class="text_left"><input type="text" name="pwdChangeDate" id="pwdChangeDate" style="width:auto; width: 150px;color: #325f86;"value="<%=pwdChangeDate.toString()%>" readonly/></td>
		</tr>
		 <tr class="footer">
         <td colspan="11">
          <input type="button" name="button" id="button"  value="修 改" onclick="update()" class="button" />
         </td>
       </tr>
 </table>
 </div>
 </form>

</body>
</html>